package com.gjy.spring.s10;

import com.gjy.spring.s10.service.MyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * agent 增强
 * 需要添加VM Option参数: -javaagent:D:/develpoment-util-package/apache-maven-3.8.6/repository/org/aspectj/aspectjweaver/1.9.7/aspectjweaver-1.9.7.jar
 *
 * @author 宫静雨
 * @version 1.0
 * @since 2023-12-20 14:36:40
 */
@SpringBootApplication
public class S10App {
    private static final Logger log = LoggerFactory.getLogger(S10App.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(S10App.class, args);
        MyService service = context.getBean(MyService.class);

        log.info("service.getClass: {}", service.getClass());
        service.foo();

        context.close();
    }
}
